package com.ruoyi.logistic.service.impl;

import com.ruoyi.logistic.domain.NetworkHqSettleSubject;
import com.ruoyi.logistic.mapper.NetworkHqSettleSubjectMapper;
import com.ruoyi.logistic.service.NetworkHqSettleSubjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class NetworkHqSettleSubjectServiceImpl implements NetworkHqSettleSubjectService {
    @Autowired
    private NetworkHqSettleSubjectMapper networkHqSettleSubjectMapper;
    @Override
    public List<NetworkHqSettleSubject> selectAll() {
        List<NetworkHqSettleSubject> networkHqSettleSubjects = networkHqSettleSubjectMapper.selectAll();
        for (NetworkHqSettleSubject networkHqSettleSubject:networkHqSettleSubjects){
            List<NetworkHqSettleSubject> networkHqSettleSubjects1 = networkHqSettleSubjectMapper.findTwoLevel(networkHqSettleSubject.getId());
            for (NetworkHqSettleSubject networkHqSettleSubject1 : networkHqSettleSubjects1){
                networkHqSettleSubject1.setHqSettleSubjectList(networkHqSettleSubjectMapper.findThreeLevel(networkHqSettleSubject1.getId()));
            }
            networkHqSettleSubject.setHqSettleSubjectList(networkHqSettleSubjects1);
        }
        return networkHqSettleSubjects;
    }
}
